package org.etom.test.connector;

import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;

public class Activator implements BundleActivator {

  private TestRunner testRunner;
  
	/*
	 * (non-Javadoc)
	 * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
	 */
	public void start(BundleContext context) throws Exception {
	  if (testRunner != null) {
	    testRunner.stop(context);
	  }
	  testRunner = new TestRunner();
	  testRunner.start(context);
	}

	/*
	 * (non-Javadoc)
	 * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
	 */
	public void stop(BundleContext context) throws Exception {
	  if (testRunner != null) {
	    testRunner.stop(context);
	    testRunner = null;
	  }
	}

}
